<script setup>
const emit = defineEmits({
  // 没有校验
  click: null,
  // 事件校验
  submit: ({ email, password }) => {
    if (email && password) {
      return true
    } else {
      console.warn('Invalid submit event payload!')
      return false
    }
  }
})
const email = "123@qq.com"
const password = '123456'
const submitForm = () => {
  emit('submit', { email, password })
}
</script>

<template>
  <div>
    <button @click="submitForm">
      提交
    </button>
  </div>
</template>